package LinkedList_03.Single_Linked_List_03;

/*
 * @Author 罗
 * @date 2020/3/11 - 5:14 下午
 *  定义一个HeroNode，每个HeroNode就是一个节点
 */

public class HeroNode {
    public int number;
    public String name;
    public String heroName;
//    用于指向下一个节点
    public HeroNode nextNode;

    public HeroNode() {
    }

    public HeroNode(int number, String name) {
        this.number = number;
        this.name = name;
    }
//    平时不要乱改，只用于队列的反转
    public void setNextNode(HeroNode nextNode) {
        this.nextNode = nextNode;
    }

    /*
                    没必要强制在这里指定下一个节点，
                    指定下一个节点的任务交给管理本节点的SingleLinkedList来处理
                */
    public HeroNode(HeroNode nextNode) {
        this.nextNode = nextNode;
    }

    public HeroNode(int number, String name, String heroName) {
        this.number = number;
        this.name = name;
        this.heroName = heroName;
    }

    public HeroNode(int number) {
        this.number = number;
    }

    @Override
    public String toString() {
        return "HeroNode{" +
                "number=" + number +
                ", name='" + name + '\'' +
                ", heroName='" + heroName + '\'' +
//禁止套娃               ", nextNode=" + nextNode +
                '}';
    }
}
